import React from 'react';
import Table from 'material-ui/lib/table/table';
import TableHeaderColumn from 'material-ui/lib/table/table-header-column';
import TableRow from 'material-ui/lib/table/table-row';
import TableHeader from 'material-ui/lib/table/table-header';
import TableRowColumn from 'material-ui/lib/table/table-row-column';
import TableBody from 'material-ui/lib/table/table-body';
import DropDownMenuArea from './button-group';
const style = {
    header:{
        textAlign:'center'
        }
};
var TableArea = React.createClass({
    open: function () {
        console.log('123')
    },
    test: function (selectedRows) {
        console.log(selectedRows)
    },
    render: function () {
        var row = this.props.data.map(function (item, index) {
            return (
                <TableRow key={index+1} selectable={false}>
                    <TableRowColumn style={style.header}>{index + 1}</TableRowColumn>
                    <TableRowColumn style={style.header}>{item.title}</TableRowColumn>
                    <TableRowColumn style={style.header}>{item.content}</TableRowColumn>
                    <TableRowColumn style={style.header}>
                        <DropDownMenuArea value={item.confirm}
                        items={[{content:"同意",value:1},{content:"拒绝",value:2}]}/></TableRowColumn>
                </TableRow>
            )
        }, this);
        return (
            <Table fixedHeader={true} height={'200px'} selectable={false}>
                <TableHeader displaySelectAll={false} adjustForCheckbox={false} >
                    <TableRow >
                        <TableHeaderColumn style={style.header}>序号</TableHeaderColumn>
                        <TableHeaderColumn style={style.header}>名称</TableHeaderColumn>
                        <TableHeaderColumn style={style.header}>内容</TableHeaderColumn>
                        <TableHeaderColumn style={style.header}>操作</TableHeaderColumn>
                    </TableRow>
                </TableHeader>
                <TableBody showRowHover={true} displayRowCheckbox={false}>
                    {row}
                </TableBody>
            </Table>
        )
    }
});

export default TableArea;